Centralize inline SVGs as Django template includes#387
Closed
C4ptainCrunch wants to merge 4 commits into
Closed
Conversation
All 65 inline SVGs across 14 templates are replaced with
`{% include "icons/bi-<name>.html" %}` calls. The 42 icon files
live in www/templates/icons/ and accept size, class, style, fill,
and title parameters, keeping colour/size variants without duplication.
https://claude.ai/code/session_01UWj2RmH7gTNiyvr2C5fgy9
Before/after screenshots captured with Rodney (Chromium headless) comparing commit 6f649c6 (inline SVGs) vs 7419b9e (centralized includes). https://claude.ai/code/session_01UWj2RmH7gTNiyvr2C5fgy9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces all 65 inline SVGs spread across 14 templates with reusable Django template includes stored in
www/templates/icons/. Net: 57 files changed, 234 insertions, 366 deletions.www/templates/icons/bi-*.html, each parameterised withsize,class,style,fill,titleIcon include syntax
{% include "icons/bi-download.html" %} {% include "icons/bi-download.html" with size=20 %} {% include "icons/bi-star-fill.html" with class="text-warning hover-spin" %} {% include "icons/bi-exclamation-triangle-fill.html" with size=22 style="color: #ef4444;" %} {% include "icons/bi-check-circle.html" with fill="green" %} {% include "icons/bi-patch-check-fill.html" with class="text-primary" title="Staff pick" %}Visual regression — before vs after
Screenshots taken with Rodney (Chromium headless). Before = commit
6f649c6(inline SVGs). After = this branch.Course page — 13 icons (archive-fill, file-earmark-plus, star, funnel, eye-slash, patch-check, pencil, download, …)
Document viewer — 11 icons (arrow-left, staff-pick badge, 2× download, pencil, box-arrow-up, thumbs-up, thumbs-down, flag, …)
Upload page — 12 icons (check-circle
fill="green", 7 file-type icons, cloud-arrow-upsize=32, cloud-upload, …)Moderation dashboard — people-fill icon in header button
Moderators management — exclamation-triangle-fill warning icon
Representative request (rejected state) —
style="color: #ef4444;"andstyle="color: #6b7280;"inline-hex-color iconsAll icon parameters verified working:
size,class,style,fill,title. Zero visual regressions across all 14 modified templates.https://claude.ai/code/session_01UWj2RmH7gTNiyvr2C5fgy9